<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>一天一个想法</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta property="og:type" content="website">
<meta property="og:title" content="一天一个想法">
<meta property="og:url" content="https://www.yitianyigexiangfa.com/page/3/index.html">
<meta property="og:site_name" content="一天一个想法">
<meta property="og:locale">
<meta property="article:author" content="刘备">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="一天一个想法" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/css/style.css">

  
    
<link rel="stylesheet" href="/fancybox/jquery.fancybox.min.css">

  
  
<meta name="generator" content="Hexo 6.3.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">一天一个想法</a>
      </h1>
      
        <h2 id="subtitle-wrap">
          <a href="/" id="subtitle">人间烟火气，最抚凡人心</a>
        </h2>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"><span class="fa fa-bars"></span></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
        
          <a class="nav-icon" href="/atom.xml" title="RSS Feed"><span class="fa fa-rss"></span></a>
        
        <a class="nav-icon nav-search-btn" title="Search"><span class="fa fa-search"></span></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://www.yitianyigexiangfa.com"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main">
  
    <article id="post-拍个自拍照" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2021/04/19/%E6%8B%8D%E4%B8%AA%E8%87%AA%E6%8B%8D%E7%85%A7/" class="article-date">
  <time class="dt-published" datetime="2021-04-19T11:32:00.000Z" itemprop="datePublished">2021-04-19</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="p-name article-title" href="/2021/04/19/%E6%8B%8D%E4%B8%AA%E8%87%AA%E6%8B%8D%E7%85%A7/">拍头像</a>
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p><img src="https://obs202211121201.obs.cn-north-4.myhuaweicloud.com/camera.jpeg" alt="相机拍摄效果"></p>
<h3 id="相机与照片参数"><a href="#相机与照片参数" class="headerlink" title="相机与照片参数"></a>相机与照片参数</h3><ul>
<li>Sony A600 </li>
<li>Sigma 30mm F1.4</li>
<li>光圈 F1.4</li>
<li>快门 1&#x2F;60</li>
<li>ISO 125</li>
</ul>
<p><img src="https://obs202211121201.obs.cn-north-4.myhuaweicloud.com/liubeiAvatar.jpeg" alt="处理效果"></p>
<h3 id="醒图处理步骤"><a href="#醒图处理步骤" class="headerlink" title="醒图处理步骤"></a>醒图处理步骤</h3><ul>
<li>人像-&gt;自动美颜-&gt;一键美颜</li>
<li>调节-&gt;饱和度 +10</li>
<li>调节-&gt;色调 +30</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://www.yitianyigexiangfa.com/2021/04/19/%E6%8B%8D%E4%B8%AA%E8%87%AA%E6%8B%8D%E7%85%A7/" data-id="clmk3oj4w002208nyda1yb84t" data-title="拍头像" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%BD%A2%E8%B1%A1/" rel="tag">形象</a></li></ul>

    </footer>
  </div>
  
</article>



  
    <article id="post-如何做辣椒炒肉" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2021/04/18/%E5%A6%82%E4%BD%95%E5%81%9A%E8%BE%A3%E6%A4%92%E7%82%92%E8%82%89/" class="article-date">
  <time class="dt-published" datetime="2021-04-18T12:00:00.000Z" itemprop="datePublished">2021-04-18</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="p-name article-title" href="/2021/04/18/%E5%A6%82%E4%BD%95%E5%81%9A%E8%BE%A3%E6%A4%92%E7%82%92%E8%82%89/">如何做辣椒炒肉</a>
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <h3 id="辣椒炒肉步骤"><a href="#辣椒炒肉步骤" class="headerlink" title="辣椒炒肉步骤"></a>辣椒炒肉步骤</h3><ul>
<li>切肉丝</li>
<li>放盐，料酒、白糖、豆瓣酱、生粉搅拌</li>
<li>切辣椒</li>
<li>起锅放油，倒入肉丝爆炒，盛出来</li>
<li>炒辣椒至断生</li>
<li>倒入肉丝回锅</li>
<li>放入葱花</li>
<li>盛盘</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://www.yitianyigexiangfa.com/2021/04/18/%E5%A6%82%E4%BD%95%E5%81%9A%E8%BE%A3%E6%A4%92%E7%82%92%E8%82%89/" data-id="clmk3oj4k001k08ny5pxsg7qq" data-title="如何做辣椒炒肉" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%81%9A%E8%8F%9C/" rel="tag">做菜</a></li></ul>

    </footer>
  </div>
  
</article>



  
    <article id="post-使用阿里云效自动部署github pages博客" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2021/04/17/%E4%BD%BF%E7%94%A8%E9%98%BF%E9%87%8C%E4%BA%91%E6%95%88%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2github%20pages%E5%8D%9A%E5%AE%A2/" class="article-date">
  <time class="dt-published" datetime="2021-04-17T22:52:00.000Z" itemprop="datePublished">2021-04-17</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="p-name article-title" href="/2021/04/17/%E4%BD%BF%E7%94%A8%E9%98%BF%E9%87%8C%E4%BA%91%E6%95%88%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2github%20pages%E5%8D%9A%E5%AE%A2/">使用阿里云效自动部署github pages博客</a>
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p><img src="https://obs202211121201.obs.cn-north-4.myhuaweicloud.com/blogAutoDeploySequenceUML.jpg" alt="博客自动部署时序图"></p>
<h3 id="使用到的工具和技术"><a href="#使用到的工具和技术" class="headerlink" title="使用到的工具和技术"></a>使用到的工具和技术</h3><ul>
<li>github(webhook、Github Pages、token)</li>
<li>阿里云效(流水线构建、部署)</li>
<li>Docker(镜像)</li>
<li>hexo（根据markdown生产html页面文件、hexo deploy to git）</li>
<li>阿里云容器镜像服务(镜像仓库)</li>
<li>Digital Ocean(保证博客发布到Github的稳定)</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://www.yitianyigexiangfa.com/2021/04/17/%E4%BD%BF%E7%94%A8%E9%98%BF%E9%87%8C%E4%BA%91%E6%95%88%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2github%20pages%E5%8D%9A%E5%AE%A2/" data-id="clmk3oj3x001208ny6f3ydz5b" data-title="使用阿里云效自动部署github pages博客" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/CICD/" rel="tag">CICD</a></li></ul>

    </footer>
  </div>
  
</article>



  
    <article id="post-Docker教程" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2021/04/17/Docker%E6%95%99%E7%A8%8B/" class="article-date">
  <time class="dt-published" datetime="2021-04-17T21:52:00.000Z" itemprop="datePublished">2021-04-17</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="p-name article-title" href="/2021/04/17/Docker%E6%95%99%E7%A8%8B/">Docker教程</a>
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <h3 id="docker-命令列表"><a href="#docker-命令列表" class="headerlink" title="docker 命令列表"></a>docker 命令列表</h3><ul>
<li>docker build</li>
<li>docker run</li>
<li>docker network</li>
<li>docker exec</li>
<li>docker inspect</li>
<li>docker tag</li>
<li>docker login</li>
<li>docker ps</li>
<li>docker stop  </li>
<li>docker images</li>
<li>docker rmi</li>
<li>docker search</li>
<li>docker pull</li>
<li>docker push</li>
</ul>
<h3 id="Dockerfile关键词列表"><a href="#Dockerfile关键词列表" class="headerlink" title="Dockerfile关键词列表"></a>Dockerfile关键词列表</h3><ul>
<li>FROM</li>
<li>VOLUME  </li>
<li>ARG</li>
<li>ENV</li>
<li>ADD</li>
<li>COPY</li>
<li>EXPOSE</li>
<li>WORKDIR</li>
<li>ENTRYPOINT</li>
<li>USER</li>
<li>CMD</li>
<li>RUN</li>
</ul>
<h3 id="docker-build命令执行示例"><a href="#docker-build命令执行示例" class="headerlink" title="docker build命令执行示例"></a>docker build命令执行示例</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker build -t hexo_docker:1.0.1 --no-cache .</span><br></pre></td></tr></table></figure>

<h3 id="docker-run命令执行示例"><a href="#docker-run命令执行示例" class="headerlink" title="docker run命令执行示例"></a>docker run命令执行示例</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker run hexo_docker:1.0.1</span><br></pre></td></tr></table></figure>

<h3 id="docker-命令执行示例"><a href="#docker-命令执行示例" class="headerlink" title="docker 命令执行示例"></a>docker 命令执行示例</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker exec -it $&#123;容器ID&#125; /bin/bash </span><br></pre></td></tr></table></figure>

<h3 id="docker-ps"><a href="#docker-ps" class="headerlink" title="docker ps"></a>docker ps</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">docker ps</span><br><span class="line">docker ps -a</span><br></pre></td></tr></table></figure>

<h3 id="docker-rm-容器ID"><a href="#docker-rm-容器ID" class="headerlink" title="docker rm ${容器ID}"></a>docker rm ${容器ID}</h3><ul>
<li>删除容器</li>
</ul>
<h3 id="docker-rmi-镜像ID"><a href="#docker-rmi-镜像ID" class="headerlink" title="docker rmi ${镜像ID}"></a>docker rmi ${镜像ID}</h3><ul>
<li>删除镜像</li>
</ul>
<h3 id="docker-tag"><a href="#docker-tag" class="headerlink" title="docker tag"></a>docker tag</h3><ul>
<li>docker tag : 标记本地镜像，将其归入某一仓库</li>
<li>docker tag demo:0.0.1-SNAPSHOT yitianyigexiangfa&#x2F;springboot-k8s-tutorial:1.0</li>
</ul>
<h3 id="docker-search"><a href="#docker-search" class="headerlink" title="docker search"></a>docker search</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">docker search nginx</span><br><span class="line">docker search -f stars=10 java</span><br><span class="line">docker search yitianyigexiangfa</span><br></pre></td></tr></table></figure>

<h3 id="docker-pull"><a href="#docker-pull" class="headerlink" title="docker pull"></a>docker pull</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker pull yitianyigexiangfa/k8s_tutorial_fortune:1.0</span><br></pre></td></tr></table></figure>

<h3 id="docker-push"><a href="#docker-push" class="headerlink" title="docker push"></a>docker push</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker push yitianyigexiangfa/k8s_tutorial_fortune:1.0</span><br></pre></td></tr></table></figure>

<h3 id="docker-hub"><a href="#docker-hub" class="headerlink" title="docker hub"></a><a target="_blank" rel="noopener" href="https://hub.docker.com/">docker hub</a></h3><ul>
<li>类似于github里有存了很多开源代码，docker hub里存了很多开放的容器</li>
<li>例如<a target="_blank" rel="noopener" href="https://hub.docker.com/_/redis">redis</a>在docker hub的地址是这样的</li>
</ul>
<h3 id="Dockerfile例子"><a href="#Dockerfile例子" class="headerlink" title="Dockerfile例子"></a>Dockerfile例子</h3><figure class="highlight dockerfile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FROM</span> java:<span class="number">8</span></span><br><span class="line"><span class="keyword">COPY</span><span class="language-bash"> target/*.jar app.jar</span></span><br><span class="line"><span class="keyword">ENTRYPOINT</span><span class="language-bash"> [<span class="string">&quot;java&quot;</span>, <span class="string">&quot;-jar&quot;</span>, <span class="string">&quot;app.jar&quot;</span>]</span></span><br></pre></td></tr></table></figure>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://www.yitianyigexiangfa.com/2021/04/17/Docker%E6%95%99%E7%A8%8B/" data-id="clmk3oj35000108ny4i11hafe" data-title="Docker教程" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/DOCKER/" rel="tag">DOCKER</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA/" rel="tag">计算机</a></li></ul>

    </footer>
  </div>
  
</article>



  
    <article id="post-java并发集合" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2019/08/06/java%E5%B9%B6%E5%8F%91%E9%9B%86%E5%90%88/" class="article-date">
  <time class="dt-published" datetime="2019-08-06T10:59:16.000Z" itemprop="datePublished">2019-08-06</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="p-name article-title" href="/2019/08/06/java%E5%B9%B6%E5%8F%91%E9%9B%86%E5%90%88/">java并发集合</a>
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p><img src="https://obs202211121201.obs.cn-north-4.myhuaweicloud.com/08_06_birthday.jpeg" alt="birthday"></p>
<h3 id="常用并发集合"><a href="#常用并发集合" class="headerlink" title="常用并发集合"></a>常用并发集合</h3><ul>
<li>ConcurrentLinkedDeque；非阻塞式列表</li>
<li>LinkedBlockingDeque；阻塞式列表</li>
<li>LinkedTransferQueue；用于数据生成或消费的阻塞式列表</li>
<li>PriorityBlockingQueue；按优先级排序列表元素的阻塞式列表</li>
<li>DelayQueue；带有延迟列表元素的阻塞式列表</li>
<li>ConcurrentSkipListMap；非阻塞式可遍历映射</li>
<li>ThreadLocalRandom；随机数字</li>
<li>AtomicLong、AtomicIntegerArray；原子实现类</li>
</ul>
<h3 id="业务类"><a href="#业务类" class="headerlink" title="业务类"></a>业务类</h3><ol>
<li>继承或实现声明</li>
<li>类属性</li>
<li>构造方法</li>
<li>main方法</li>
<li>override的方法</li>
<li>私有方法</li>
</ol>
<h3 id="队列常见的操作"><a href="#队列常见的操作" class="headerlink" title="队列常见的操作"></a>队列常见的操作</h3><ul>
<li>add</li>
<li>size</li>
<li>poll</li>
<li>get</li>
<li>take（获取并移除）</li>
<li>remove</li>
<li>peek</li>
</ul>
<h4 id="队列常见单词"><a href="#队列常见单词" class="headerlink" title="队列常见单词"></a>队列常见单词</h4><ul>
<li>first</li>
<li>last</li>
</ul>
<h3 id="优先级"><a href="#优先级" class="headerlink" title="优先级"></a>优先级</h3><p>如何优先，需要通过实现Comparable接口，提供compareTo方法</p>
<h3 id="延迟"><a href="#延迟" class="headerlink" title="延迟"></a>延迟</h3><p>Delayed接口，实现compareTo方法，getDelay方法</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://www.yitianyigexiangfa.com/2019/08/06/java%E5%B9%B6%E5%8F%91%E9%9B%86%E5%90%88/" data-id="clmk3oj3d000a08ny22rf0me3" data-title="java并发集合" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JAVA/" rel="tag">JAVA</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA/" rel="tag">计算机</a></li></ul>

    </footer>
  </div>
  
</article>



  
    <article id="post-java的多线程与并发" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2019/08/05/java%E7%9A%84%E5%A4%9A%E7%BA%BF%E7%A8%8B%E4%B8%8E%E5%B9%B6%E5%8F%91/" class="article-date">
  <time class="dt-published" datetime="2019-08-05T09:25:00.000Z" itemprop="datePublished">2019-08-05</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="p-name article-title" href="/2019/08/05/java%E7%9A%84%E5%A4%9A%E7%BA%BF%E7%A8%8B%E4%B8%8E%E5%B9%B6%E5%8F%91/">java的多线程与并发</a>
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p><img src="https://obs202211121201.obs.cn-north-4.myhuaweicloud.com/08_05cloud.jpeg" alt="cloud"></p>
<h3 id="java创建线程"><a href="#java创建线程" class="headerlink" title="java创建线程"></a>java创建线程</h3><ul>
<li>extend Thread</li>
<li>implements Runnable</li>
</ul>
<h3 id="java多线程计算器"><a href="#java多线程计算器" class="headerlink" title="java多线程计算器"></a>java多线程计算器</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">class</span> <span class="title class_">Caculator</span> <span class="keyword">implements</span> <span class="title class_">Runnable</span>&#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">run</span><span class="params">()</span>&#123;</span><br><span class="line">          <span class="keyword">for</span>(<span class="type">int</span> <span class="variable">i</span> <span class="operator">=</span> <span class="number">0</span>; i &lt; <span class="number">100</span>; i ++)&#123;</span><br><span class="line">              System.out.println(“%s, value=%d”, Thread.currentThread().getName(), i);</span><br><span class="line">        &#125;</span><br><span class="line">     &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">class</span> <span class="title class_">Application</span>&#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="keyword">for</span>(<span class="type">int</span> <span class="variable">i</span> <span class="operator">=</span> <span class="number">0</span>; i &lt; <span class="number">10</span>; i ++)&#123;</span><br><span class="line">                <span class="type">Caculator</span> <span class="variable">c</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Caculator</span>();</span><br><span class="line">                <span class="type">Thread</span> <span class="variable">t</span> <span class="operator">=</span>  <span class="keyword">new</span> <span class="title class_">Thread</span>(c);</span><br><span class="line">                t.start();</span><br><span class="line">         &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="计数器"><a href="#计数器" class="headerlink" title="计数器"></a>计数器</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Counter</span> <span class="keyword">implements</span> <span class="title class_">Runnable</span>&#123;</span><br><span class="line">    <span class="keyword">private</span> <span class="type">int</span> <span class="variable">count</span> <span class="operator">=</span> <span class="number">0</span>;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">run</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="keyword">for</span> (<span class="type">int</span> <span class="variable">i</span> <span class="operator">=</span> <span class="number">0</span>; i &lt; <span class="number">10000</span>; i ++)&#123;</span><br><span class="line">            count ++;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">     <span class="keyword">public</span> <span class="keyword">static</span> <span class="type">int</span> <span class="title function_">getCountValue</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="keyword">return</span> count;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Application</span>&#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="type">Counter</span> <span class="variable">c</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Counter</span>();</span><br><span class="line">         <span class="type">Thread</span> <span class="variable">t</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Thread</span>();</span><br><span class="line">        t.start();</span><br><span class="line">        System.out.println(Count.getCountValue());</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="使用join方法"><a href="#使用join方法" class="headerlink" title="使用join方法"></a>使用join方法</h3><ul>
<li>子线程调用join方法，让main线程等待<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">MySubThread</span> <span class="keyword">extends</span> <span class="title class_">Thread</span>&#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">run</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="type">int</span> <span class="variable">sleepTime</span> <span class="operator">=</span> <span class="number">2000</span>;</span><br><span class="line">        Thread.sleep(sleepTime);</span><br><span class="line">        System.out.println(“MySubThread run finished!”);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Application</span>&#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="type">MySubThread</span> <span class="variable">t</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">MySubThread</span>();</span><br><span class="line">        t.start();</span><br><span class="line">        <span class="comment">// t.join();</span></span><br><span class="line">        System.out.println(“Main Thread finished!”);</span><br><span class="line">    &#125;</span><br><span class="line">&#125; </span><br></pre></td></tr></table></figure></li>
</ul>
<h3 id="线程上锁"><a href="#线程上锁" class="headerlink" title="线程上锁"></a>线程上锁</h3><ul>
<li>synchronized</li>
<li>lock与ReentrantedLock</li>
</ul>
<h4 id="synchronized版本的计数器"><a href="#synchronized版本的计数器" class="headerlink" title="synchronized版本的计数器"></a>synchronized版本的计数器</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Counter</span> <span class="keyword">implements</span> <span class="title class_">Runnable</span>&#123;</span><br><span class="line">    <span class="type">int</span> <span class="variable">count</span> <span class="operator">=</span> <span class="number">0</span>;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="type">int</span> <span class="title function_">getCount</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="keyword">return</span> count;</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">run</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="keyword">for</span>(<span class="type">int</span> <span class="variable">i</span> <span class="operator">=</span> <span class="number">0</span>; i &lt; <span class="number">10000</span>; i ++)&#123;</span><br><span class="line">            <span class="keyword">synchronized</span>(<span class="built_in">this</span>)&#123;</span><br><span class="line">                count ++;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125; </span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Application</span>&#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="type">Counter</span> <span class="variable">c</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Counter</span>();</span><br><span class="line">        <span class="type">Thread</span> <span class="variable">t1</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Thread</span>();</span><br><span class="line">        <span class="type">Thread</span> <span class="variable">t2</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Thread</span>();</span><br><span class="line">        t1.start();</span><br><span class="line">        t1.join();</span><br><span class="line">        t2.start();</span><br><span class="line">        t2.join();</span><br><span class="line">        System.out.println(“count is: ” + Count.getCount());</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h4 id="synchronized版本的计数器之二，-使用synchronized给实例方法加锁"><a href="#synchronized版本的计数器之二，-使用synchronized给实例方法加锁" class="headerlink" title="synchronized版本的计数器之二， 使用synchronized给实例方法加锁"></a>synchronized版本的计数器之二， 使用synchronized给实例方法加锁</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Counter</span> <span class="keyword">implements</span> <span class="title class_">Runnable</span>&#123;</span><br><span class="line">    <span class="type">int</span> <span class="variable">count</span> <span class="operator">=</span> <span class="number">0</span>;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="type">int</span> <span class="title function_">getCount</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="keyword">return</span> count;</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">synchronized</span> <span class="keyword">void</span> <span class="title function_">run</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="keyword">for</span>(<span class="type">int</span> <span class="variable">i</span> <span class="operator">=</span> <span class="number">0</span>; i &lt; <span class="number">10000</span>; i ++)&#123;</span><br><span class="line">                count ++;</span><br><span class="line">        &#125; </span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Application</span>&#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="type">Counter</span> <span class="variable">c</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Counter</span>();</span><br><span class="line">        <span class="type">Thread</span> <span class="variable">t1</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Thread</span>();</span><br><span class="line">        <span class="type">Thread</span> <span class="variable">t2</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Thread</span>();</span><br><span class="line">        t1.start();</span><br><span class="line">        t1.join();</span><br><span class="line">        t2.start();</span><br><span class="line">        t2.join();</span><br><span class="line">        System.out.println(“count is: ” + Count.getCount());</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h4 id="synchronized版本的计数器之三，使用synchronized修饰静态方法"><a href="#synchronized版本的计数器之三，使用synchronized修饰静态方法" class="headerlink" title="synchronized版本的计数器之三，使用synchronized修饰静态方法"></a>synchronized版本的计数器之三，使用synchronized修饰静态方法</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Counter</span> <span class="keyword">implements</span> <span class="title class_">Runnable</span>&#123;</span><br><span class="line">    <span class="type">int</span> <span class="variable">count</span> <span class="operator">=</span> <span class="number">0</span>;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="type">int</span> <span class="title function_">getCount</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="keyword">return</span> count;</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">run</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="keyword">for</span>(<span class="type">int</span> <span class="variable">i</span> <span class="operator">=</span> <span class="number">0</span>; i &lt; <span class="number">10000</span>; i ++)&#123;</span><br><span class="line">                increase();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125; </span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> synchronize <span class="title function_">increase</span><span class="params">()</span>&#123;</span><br><span class="line">        count ++;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Application</span>&#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">()</span>&#123;</span><br><span class="line">        <span class="type">Counter</span> <span class="variable">c</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Counter</span>();</span><br><span class="line">        <span class="type">Thread</span> <span class="variable">t1</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Thread</span>();</span><br><span class="line">        <span class="type">Thread</span> <span class="variable">t2</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Thread</span>();</span><br><span class="line">        t1.start();</span><br><span class="line">        t1.join();</span><br><span class="line">        t2.start();</span><br><span class="line">        t2.join();</span><br><span class="line">        System.out.println(“count is: ” + Count.getCount());</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>


<h4 id="笔记"><a href="#笔记" class="headerlink" title="笔记"></a>笔记</h4><ul>
<li>reentrant单词也作re-entrant，entrant为进入者、新会员的意思</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://www.yitianyigexiangfa.com/2019/08/05/java%E7%9A%84%E5%A4%9A%E7%BA%BF%E7%A8%8B%E4%B8%8E%E5%B9%B6%E5%8F%91/" data-id="clmk3oj3h000b08nyg1a3c4wq" data-title="java的多线程与并发" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JAVA/" rel="tag">JAVA</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA/" rel="tag">计算机</a></li></ul>

    </footer>
  </div>
  
</article>



  
    <article id="post-过去不等于未来" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2019/08/01/%E8%BF%87%E5%8E%BB%E4%B8%8D%E7%AD%89%E4%BA%8E%E6%9C%AA%E6%9D%A5/" class="article-date">
  <time class="dt-published" datetime="2019-08-01T21:00:00.000Z" itemprop="datePublished">2019-08-01</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="p-name article-title" href="/2019/08/01/%E8%BF%87%E5%8E%BB%E4%B8%8D%E7%AD%89%E4%BA%8E%E6%9C%AA%E6%9D%A5/">过去不等于未来</a>
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p><img src="https://obs202211121201.obs.cn-north-4.myhuaweicloud.com/07_31adidas.jpeg" alt="smile"></p>
<h4 id="习惯"><a href="#习惯" class="headerlink" title="习惯"></a>习惯</h4><p>同样的环境，同样的情况，对于同样一件事，昨天你会这样做，只随着时间的变化，你的行动一般是一样的，这就是习惯。  </p>
<h4 id="温水煮青蛙"><a href="#温水煮青蛙" class="headerlink" title="温水煮青蛙"></a>温水煮青蛙</h4><p>思考这样一个问题，如何知道自己是不是被温水煮着的青蛙。首先，视野要大过头顶，知道什么是锅，锅下架着柴火，柴火会让锅里的水变热，青蛙不能在水温高的环境里生存。另外，要和朋友聊聊，和在锅里的朋友聊聊，感觉异常了，相互帮助能想个办法；你在锅里，朋友在河里，聊一聊各自的环境，你能帮朋友度过寒冬，朋友能帮你认识到燃烧的柴火。突破边界，找到跳出锅的方法，水冷的时候你能有地方保暖，水热的时候能很快跳出锅的束缚。  </p>
<h4 id="人生是一条河吗"><a href="#人生是一条河吗" class="headerlink" title="人生是一条河吗"></a>人生是一条河吗</h4><p>在河里游泳，是不是不往前游就会往下沉？其实也不会，只要你会踩水，你就能一直浮着，呼气、吸气。如果你沉到了水底，你一直往下沉，你只有在自己还有气之前把自己浮出水面。  </p>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://www.yitianyigexiangfa.com/2019/08/01/%E8%BF%87%E5%8E%BB%E4%B8%8D%E7%AD%89%E4%BA%8E%E6%9C%AA%E6%9D%A5/" data-id="clmk3oj5h003408ny8evcfzky" data-title="过去不等于未来" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
    </footer>
  </div>
  
</article>



  
    <article id="post-通过完成挑战来学习新知识" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2018/04/17/%E9%80%9A%E8%BF%87%E5%AE%8C%E6%88%90%E6%8C%91%E6%88%98%E6%9D%A5%E5%AD%A6%E4%B9%A0%E6%96%B0%E7%9F%A5%E8%AF%86/" class="article-date">
  <time class="dt-published" datetime="2018-04-17T11:12:34.000Z" itemprop="datePublished">2018-04-17</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="p-name article-title" href="/2018/04/17/%E9%80%9A%E8%BF%87%E5%AE%8C%E6%88%90%E6%8C%91%E6%88%98%E6%9D%A5%E5%AD%A6%E4%B9%A0%E6%96%B0%E7%9F%A5%E8%AF%86/">通过完成挑战来学习新知识</a>
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p><img src="https://obs202211121201.obs.cn-north-4.myhuaweicloud.com/01_11arrow.png" alt="交通信号灯"></p>
<h4 id="陌生的技术"><a href="#陌生的技术" class="headerlink" title="陌生的技术"></a>陌生的技术</h4><p>最近在一直在做pythonchallenge这个网站提供的python挑战，以一种使用使用编程来根据线索找到答案的游戏，这个挑战涉及到python技术的方方面面，包括字符串处理，正则表达式，字符串编码解码，加密解密技术，压缩解压缩，http网络技术，图像处理，音频文件处理，算法, 甚至有一道题让我使用代码走出一个复杂的迷宫。在做这个挑战之前，我没有想到，我有一天能涉及到图像处理的技术，但到现在，我对一般的python操作已经熟练掌握，能很容易的读取读片像素点，甚至能通过编程来画出新图片。</p>
<h4 id="发生了什么"><a href="#发生了什么" class="headerlink" title="发生了什么"></a>发生了什么</h4><p>面对一道题，玩家首先想到的是这道题我要使用python的哪个库，找到一个新的库，再也不会像以前一样想要把这个库的方方面面都了解清楚，而是以解决一个实际的问题为出发点，这个时候的思路也是清晰的，安装这个库，快速找到能跑起来的代码，不断的尝试不同的技术点，尝试，不断尝试，直到将问题解决。</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://www.yitianyigexiangfa.com/2018/04/17/%E9%80%9A%E8%BF%87%E5%AE%8C%E6%88%90%E6%8C%91%E6%88%98%E6%9D%A5%E5%AD%A6%E4%B9%A0%E6%96%B0%E7%9F%A5%E8%AF%86/" data-id="clmk3oj5i003608nyh0sa17qf" data-title="通过完成挑战来学习新知识" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
    </footer>
  </div>
  
</article>



  
    <article id="post-gradle入门" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2017/09/11/gradle%E5%85%A5%E9%97%A8/" class="article-date">
  <time class="dt-published" datetime="2017-09-11T10:35:56.000Z" itemprop="datePublished">2017-09-11</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="p-name article-title" href="/2017/09/11/gradle%E5%85%A5%E9%97%A8/">gradle入门</a>
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p><img src="https://obs202211121201.obs.cn-north-4.myhuaweicloud.com/0911_hxzg2b.png" alt="入门"></p>
<h4 id="安装gradle"><a href="#安装gradle" class="headerlink" title="安装gradle"></a>安装gradle</h4><p>1、下载源码<br>2、配置环境变量<br>3、通过gradle -v命令测试安装</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://www.yitianyigexiangfa.com/2017/09/11/gradle%E5%85%A5%E9%97%A8/" data-id="clmk3oj3c000808ny0d7q0rvo" data-title="gradle入门" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/gradle/" rel="tag">gradle</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%85%A5%E9%97%A8/" rel="tag">入门</a></li></ul>

    </footer>
  </div>
  
</article>



  
    <article id="post-spring-framework研究" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2017/09/08/spring-framework%E7%A0%94%E7%A9%B6/" class="article-date">
  <time class="dt-published" datetime="2017-09-08T09:39:59.000Z" itemprop="datePublished">2017-09-08</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="p-name article-title" href="/2017/09/08/spring-framework%E7%A0%94%E7%A9%B6/">spring-framework研究</a>
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p><img src="https://obs202211121201.obs.cn-north-4.myhuaweicloud.com/0906_beiduofen_03.png" alt="贝多芬"></p>
<h3 id="Gradle-Spring构建工具"><a href="#Gradle-Spring构建工具" class="headerlink" title="Gradle  Spring构建工具"></a><a target="_blank" rel="noopener" href="https://gradle.org/">Gradle</a>  Spring构建工具</h3><h4 id="Groovy-入门"><a href="#Groovy-入门" class="headerlink" title="Groovy 入门"></a>Groovy 入门</h4><blockquote>
<p>Apache Groovy is a dynamic programming language for the Java platform.  </p>
</blockquote>
<p>Groovy是一个基于jvm的动态编程语言，gradle构建工具使用groovy作为构建配置文件，而不再是xml文件。  </p>
<p>安装Groovy<br>1.下载二进制文件<br>2.设置环境变量GROOVY_HOME,将GROOVY_HOME&#x2F;bin添加到PATH<br>3.执行groovy -v命令测试安装结果</p>
<h4 id="Gradle中如何使用Grovvy"><a href="#Gradle中如何使用Grovvy" class="headerlink" title="Gradle中如何使用Grovvy"></a>Gradle中如何使用Grovvy</h4><h4 id="以spring-framework中的build-gradle为例讲解Gradle的语法"><a href="#以spring-framework中的build-gradle为例讲解Gradle的语法" class="headerlink" title="以spring-framework中的build.gradle为例讲解Gradle的语法"></a>以spring-framework中的<a target="_blank" rel="noopener" href="https://github.com/spring-projects/spring-framework/blob/master/build.gradle">build.gradle</a>为例讲解Gradle的语法</h4><h4 id="spring-framework项目对于gradle的使用"><a href="#spring-framework项目对于gradle的使用" class="headerlink" title="spring-framework项目对于gradle的使用"></a>spring-framework项目对于gradle的使用</h4><h3 id="Spring研究过程中出现的版本控制问题"><a href="#Spring研究过程中出现的版本控制问题" class="headerlink" title="Spring研究过程中出现的版本控制问题"></a>Spring研究过程中出现的版本控制问题</h3><p>从spring-framework远程仓库fork了代码到自己的仓库之后，我如何同步spring-framework的远程更新？</p>
<p>1.列出当前配置的所有远程仓库</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git remote -v</span><br></pre></td></tr></table></figure>
<p>2.增加上游</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git remote add upstream https://github.com/spring-projects/spring-framework.git</span><br></pre></td></tr></table></figure>
<p>3.测试上游增加结果</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git remote -v</span><br></pre></td></tr></table></figure>
<p>4.选择要更新的分支</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git checkout master</span><br></pre></td></tr></table></figure>
<p>5.从上游更新代码</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git fetch upstream</span><br><span class="line">git merge upstream/master</span><br></pre></td></tr></table></figure>
<p>6.同步到自己的github仓库</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push</span><br></pre></td></tr></table></figure>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://www.yitianyigexiangfa.com/2017/09/08/spring-framework%E7%A0%94%E7%A9%B6/" data-id="clmk3oj3p000p08ny2ozk7tin" data-title="spring-framework研究" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E7%A0%94%E7%A9%B6/" rel="tag">研究</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA/" rel="tag">计算机</a></li></ul>

    </footer>
  </div>
  
</article>



  


  <nav id="page-nav">
    
    <a class="extend prev" rel="prev" href="/page/2/">&laquo; Prev</a><a class="page-number" href="/">1</a><a class="page-number" href="/page/2/">2</a><span class="page-number current">3</span><a class="page-number" href="/page/4/">4</a><a class="page-number" href="/page/5/">5</a><a class="page-number" href="/page/6/">6</a><a class="extend next" rel="next" href="/page/4/">Next &raquo;</a>
  </nav>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/CICD/" rel="tag">CICD</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/DOCKER/" rel="tag">DOCKER</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Git/" rel="tag">Git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JAVA/" rel="tag">JAVA</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Kubernetes/" rel="tag">Kubernetes</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ai/" rel="tag">ai</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/brida/" rel="tag">brida</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gradle/" rel="tag">gradle</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/k8s/" rel="tag">k8s</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/leetcode/" rel="tag">leetcode</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spring/" rel="tag">spring</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/the-witness/" rel="tag">the witness</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/webgoat/" rel="tag">webgoat</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%81%9A%E8%8F%9C/" rel="tag">做菜</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%85%A5%E9%97%A8/" rel="tag">入门</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%88%98%E8%89%BA%E5%AF%92/" rel="tag">刘艺寒</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%89%8D%E7%AB%AF/" rel="tag">前端</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%90%8E%E7%AB%AF/" rel="tag">后端</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%91%8A%E8%AD%A6/" rel="tag">告警</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%A5%B6%E5%A5%B6/" rel="tag">奶奶</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%BD%A2%E8%B1%A1/" rel="tag">形象</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/" rel="tag">数据结构</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E6%B8%97%E9%80%8F%E6%B5%8B%E8%AF%95/" rel="tag">渗透测试</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E6%B8%B8%E6%B3%B3/" rel="tag">游泳</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%8B%AC%E7%AB%8B%E5%BC%80%E5%8F%91%E8%80%85/" rel="tag">独立开发者</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%8B%AC%E7%AB%8B%E6%B8%B8%E6%88%8F/" rel="tag">独立游戏</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%9B%91%E6%8E%A7/" rel="tag">监控</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%9F%A5%E8%AF%86%E4%BD%93%E7%B3%BB/" rel="tag">知识体系</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%A0%94%E7%A9%B6/" rel="tag">研究</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%AE%97%E6%B3%95/" rel="tag">算法</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%BD%91%E7%BB%9C%E5%AE%89%E5%85%A8/" rel="tag">网络安全</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E8%87%AA%E5%8A%A8%E5%8C%96/" rel="tag">自动化</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA/" rel="tag">计算机</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/" rel="tag">读书笔记</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E9%95%BF%E5%AE%89%E7%9A%84%E8%8D%94%E6%9E%9D/" rel="tag">长安的荔枝</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E9%AD%94%E6%96%B9/" rel="tag">魔方</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/CICD/" style="font-size: 12.5px;">CICD</a> <a href="/tags/DOCKER/" style="font-size: 10px;">DOCKER</a> <a href="/tags/Git/" style="font-size: 10px;">Git</a> <a href="/tags/JAVA/" style="font-size: 15px;">JAVA</a> <a href="/tags/Kubernetes/" style="font-size: 10px;">Kubernetes</a> <a href="/tags/ai/" style="font-size: 10px;">ai</a> <a href="/tags/brida/" style="font-size: 10px;">brida</a> <a href="/tags/gradle/" style="font-size: 10px;">gradle</a> <a href="/tags/k8s/" style="font-size: 10px;">k8s</a> <a href="/tags/leetcode/" style="font-size: 10px;">leetcode</a> <a href="/tags/spring/" style="font-size: 10px;">spring</a> <a href="/tags/the-witness/" style="font-size: 10px;">the witness</a> <a href="/tags/webgoat/" style="font-size: 10px;">webgoat</a> <a href="/tags/%E5%81%9A%E8%8F%9C/" style="font-size: 10px;">做菜</a> <a href="/tags/%E5%85%A5%E9%97%A8/" style="font-size: 10px;">入门</a> <a href="/tags/%E5%88%98%E8%89%BA%E5%AF%92/" style="font-size: 12.5px;">刘艺寒</a> <a href="/tags/%E5%89%8D%E7%AB%AF/" style="font-size: 10px;">前端</a> <a href="/tags/%E5%90%8E%E7%AB%AF/" style="font-size: 10px;">后端</a> <a href="/tags/%E5%91%8A%E8%AD%A6/" style="font-size: 10px;">告警</a> <a href="/tags/%E5%A5%B6%E5%A5%B6/" style="font-size: 10px;">奶奶</a> <a href="/tags/%E5%BD%A2%E8%B1%A1/" style="font-size: 10px;">形象</a> <a href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/" style="font-size: 10px;">数据结构</a> <a href="/tags/%E6%B8%97%E9%80%8F%E6%B5%8B%E8%AF%95/" style="font-size: 10px;">渗透测试</a> <a href="/tags/%E6%B8%B8%E6%B3%B3/" style="font-size: 10px;">游泳</a> <a href="/tags/%E7%8B%AC%E7%AB%8B%E5%BC%80%E5%8F%91%E8%80%85/" style="font-size: 10px;">独立开发者</a> <a href="/tags/%E7%8B%AC%E7%AB%8B%E6%B8%B8%E6%88%8F/" style="font-size: 10px;">独立游戏</a> <a href="/tags/%E7%9B%91%E6%8E%A7/" style="font-size: 10px;">监控</a> <a href="/tags/%E7%9F%A5%E8%AF%86%E4%BD%93%E7%B3%BB/" style="font-size: 17.5px;">知识体系</a> <a href="/tags/%E7%A0%94%E7%A9%B6/" style="font-size: 12.5px;">研究</a> <a href="/tags/%E7%AE%97%E6%B3%95/" style="font-size: 10px;">算法</a> <a href="/tags/%E7%BD%91%E7%BB%9C%E5%AE%89%E5%85%A8/" style="font-size: 10px;">网络安全</a> <a href="/tags/%E8%87%AA%E5%8A%A8%E5%8C%96/" style="font-size: 10px;">自动化</a> <a href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA/" style="font-size: 20px;">计算机</a> <a href="/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/" style="font-size: 10px;">读书笔记</a> <a href="/tags/%E9%95%BF%E5%AE%89%E7%9A%84%E8%8D%94%E6%9E%9D/" style="font-size: 10px;">长安的荔枝</a> <a href="/tags/%E9%AD%94%E6%96%B9/" style="font-size: 10px;">魔方</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/09/">September 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/08/">August 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/05/">May 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/04/">April 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/02/">February 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/01/">January 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/11/">November 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/03/">March 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/11/">November 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/05/">May 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/04/">April 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/04/">April 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/09/">September 2017</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/04/">April 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">January 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/12/">December 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">November 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/10/">October 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/09/">September 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/08/">August 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/07/">July 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/06/">June 2015</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2023/09/15/%E5%A5%A5%E6%9C%AC%E6%B5%B7%E9%BB%98/">奥本海默</a>
          </li>
        
          <li>
            <a href="/2023/08/31/%E5%BF%AB%E4%B9%90%E6%98%AF%E4%BB%80%E4%B9%88/">快乐是什么</a>
          </li>
        
          <li>
            <a href="/2023/08/02/play%20with%20lepton%20ai/">play with lepton ai</a>
          </li>
        
          <li>
            <a href="/2023/05/31/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95/">数据结构与算法</a>
          </li>
        
          <li>
            <a href="/2023/05/29/%E7%9B%91%E6%8E%A7%E7%9F%A5%E8%AF%86%E4%BD%93%E7%B3%BB/">监控知识体系</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2023 刘备<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a> <br>
      <img src="https://obs202211121201.obs.cn-north-4.myhuaweicloud.com/0.png">
      <a href="https://beian.miit.gov.cn"  target="_blank">浙ICP备19027514号-1</a> <br>
      <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33010502005766"/><p>浙公网安备 33010502005766号</p></a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="/js/jquery-3.6.4.min.js"></script>



  
<script src="/fancybox/jquery.fancybox.min.js"></script>




<script src="/js/script.js"></script>





  </div>
</body>
</html>